<?php
require_once('../Category/CATEGORY_session.php');
require_once('../Product/PRODUCT_session.php');

$products = new SessionPRODUCT();
$productRS = $products->findall();

$find_class = new SessionCATEGORY();
$datas = $find_class->findall();

/*
 * Function on javascript html 
 */
//  $(function() {
//    $( "#tabs" ).tabs();
//  });
//  
//  function addtToOrders(var1)
//{
//alert("I am an alert " + var1 + "box!");
//
//}
      
?>
    
    <div id="tabs">
  <ul>
      <?
              for ($i = 0 ; $i <= count($datas); $i++)
                {
                        echo "<li><a href='#tabs-" . $i  ."'> ". $datas[$i]['CategoryName'] . "</a></li>";
                     
                        
                            
                }
               
      ?>
      

  </ul>
      <?php
      for ($i = 0 ; $i <= count($datas); $i++)
                {
                        echo " <div id='tabs-". $i. "'> "; 
                      
					 
               for ($y = 0 ; $y <= count($productRS); $y++)
                {
               		if ($productRS[$y]['CategoryID']==$i+1)
					{
						?>
                                                    <input type='button' onclick ="addToOrders('<?=$productRS[$y]['ProductID'];?>')" value='<?=$productRS[$y]['ProductName'];?>'>
                                                <?php }
                }
  
  echo "</div>";
                        
                            
                }      ?>
      
 
</div>
